<template>
	<view class="center-list">
		<view class="hair-line">
			<view class="top-line">
				<text>
					<text class="iconfont iconcheck-circle"></text>
					<text>各种会员任你选</text>
				</text>
				<text>
					<text class="iconfont iconsmile1"></text>
					<text>每月省好多钱</text>
				</text>
				<text>
					<text class="iconfont iconYUAN"></text>
					<text>一分钟内发货</text>
				</text>
			</view>
			<view class="cell-group">
				<view class="cell-item" v-for="(item,index) in activityarea" :key="index" @click="tolink(item.id)">
					<image class="img" :src="item.img_url" mode=""></image>
					<view class="name">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		<view class="activity-list">
			<view class="tiele">
				优惠会员任你挑
			</view>
			<view class="active-list">
				<view class="cell-item" v-for="(item,index) in mainactiveList" :key="index">
					<image class="image" :src="item.img_url" mode=""></image>
					<view class="name">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<van-toast id="van-toast" />
		<!-- #endif -->
	</view>
</template>
<script>
	// #ifdef MP-WEIXIN
	import Toast from '@/wxcomponents/vant-weapp/toast/toast.js';
	// #endif
	export default {
		name:"centerList",
		props:{
			activityarea:{
				type:Array,
				default:[],
			},
			mainactiveList:{
				type:Array,
				default:[],
			}
		},
		methods:{
			tolink(id){
				var name = null;
				switch (id) {
					case 1:
						name = "";
						break;
					case 2:
						name = "";
						break;
					case 3:
						name = "";
						break;
					case 4:
						name = "";
						break;
					default:
						break;
				};
				if(name){
					this.$router({
						url:"../search/index",
					});
				}else{
					// #ifdef MP-WEIXIN
					Toast.fail('暂未开放！');
					// #endif
				}
			}
		}
	}
</script>
<style lang="scss" scoped>
	@import "../style/center_list.scss"
</style>
